#!/bin/bash

VERSION=1.0.1
git tag -a v${VERSION} -m"${VERSION}"
git push --tags

if [ -d dist ];then
  rm -rf dist
fi

mkdir dist
sed -e "s/1.0.0-development-version/${VERSION}/g" cmake/CPM.cmake > dist/CPM.cmake
sed -e "s/1.0.0-development-version/${VERSION}/g" \
    -e "s/CPM_HASH_SUM_PLACEHOLDER/$(sha256sum dist/CPM.cmake | cut -d' ' -f1)/" cmake/get_cpm.cmake > dist/get_cpm.cmake